<!DOCTYPE HTML>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../static/lib/html5shiv.js" th:src="@{/static/lib/html5shiv.js}"></script>
    <script type="text/javascript" src="../static/lib/respond.min.js" th:src="@{/static/lib/respond.min.js}"></script>
    <![endif]-->


    <link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css" th:href="@{/static/lib/bootstrap/css/bootstrap.min.css}"/>
    <link rel="stylesheet" type="text/css" href="../static/RT/css/H-ui.admin.css" th:href="@{/static/RT/css/H-ui.admin.css}"/>
    <link rel="stylesheet" type="text/css" href="../static/RT/css/H-ui.login.css" th:href="@{/static/RT/css/H-ui.login.css}"/>
    <link rel="stylesheet" type="text/css" href="../static/lib/Hui-iconfont/1.0.8/iconfont.css" th:href="@{/static/lib/Hui-iconfont/1.0.8/iconfont.css}"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="../static/lib/DD_belatedPNG_0.0.8a-min.js" th:src="@{/static/lib/DD_belatedPNG_0.0.8a-min.js}"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->

    <title>后台登录界面</title>
    <style>
        .form-label {
            text-align: right;
        }
    </style>
</head>
<body>
<input type="hidden" id="TenantId" name="TenantId" value=""/>
<div class="header" style="font-size: 38px;color: #11284A; text-indent: 2em;">麦迪斯洗车后台管理系统</div>
<div class="loginWraper">
    <div id="loginform" class="loginBox">
        <form class="form-horizontal">
            <div class="row" style="margin-top: 15px;margin-bottom: -15px;">
                <label class="col-xs-3"></label>
                <div class="col-xs-9">
                    <span id="s_alert" style="color: #ff100a">&nbsp;</span>
                </div>
            </div>
            <div class="row cl form-group">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                <div class="formControls col-xs-9">
                    <input id="userName" type="text" placeholder="账户" class="form-control" value=""/>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                <div class="formControls col-xs-9">
                    <input id="password" type="password" placeholder="密码" class="form-control" value=""/>
                </div>
            </div>
            <!--<div class="row cl">-->
            <!--<div class="formControls col-xs-8 col-xs-offset-3">-->
            <!--<input class="input-text size-L" type="text" placeholder="验证码" onblur="if(this.value==''){this.value='验证码:'}" onclick="if(this.value=='验证码:'){this.value='';}" value="验证码:" style="width:150px;">-->
            <!--<img src=""> <a id="kanbuq" href="javascript:;">看不清，换一张</a> </div>-->
            <!--</div>-->
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <label for="online">
                        <input type="checkbox" name="online" id="online" value="" style="margin-top: 0">
                        使我保持登录状态</label>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-4">
                    <input id="btn-login" onclick="loginBut()" type="button" class="btn btn-success" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="reset" class="btn btn-default" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
                </div>
            </div>
        </form>
    </div>
</div>
<!--<div class="footer">Copyright 麦迪斯洗车</div>-->
<script type="text/javascript" src="../static/lib/jquery/jquery-3.2.0.js" th:src="@{/static/lib/jquery/jquery-3.2.0.js}"></script>
<script type="text/javascript">
    $(function(){
        document.onkeydown = function(e){
            var ev = document.all ? window.event : e;
            if(ev.keyCode==13) {
                loginBut();
            }
        }
    });

    function  loginBut() {
        $.ajax({
            type: "POST",
            url: "signIn",
            dataType: "json",
            data: {
                "userName": $("#userName").val(),
                "password": $("#password").val()
            },
            success: function (data) {
                if (data.state) {
                    //登陆成功跳转首页
                    window.location = "index";
                }
                else {
                    $("#s_alert").html(data.message);
                }
            },
            fail: function () {
                $("#s_alert").innerHTML = "登录超时";
                $("#s_alert").parentNode.style.visibility = "visible";
            }
        });
    }
</script>
</body>
</html>